<template>
  <!-- 三重一大 -->
  <div class="conference_wrap">
    <div class = "tabTitle">
      <span>三重一大</span>
    </div>
    <!-- 管理端table -->
    <template v-if = "role === 'manage'">
      <ManageTable :permissionBycode = 'permissionBycode' />
    </template>
    <!-- 上传端table -->
    <template v-if = "role === 'upload'">
      <UserTable :permissionBycode = 'permissionBycode' />
    </template>
  </div>
</template>
<script>
let changeKeepAlive  = (routes, componentName, isAlive) =>{
    // routes = routes.map(item => {
    //     item.meta = item.meta ? item.meta : {}
    //     if (item.name === componentName) {
    //         item.meta.keepAlive = isAlive
    //     } else if (item.children && item.children.length != 0) {
    //         item.meta.keepAlive = false
    //         item.children = changeKeepAlive(item.children, componentName, isAlive)
    //     }
    //     return item
    // })
    // return routes
}
export default {
  beforeRouteLeave (to, from, next) {
        
    next()
  },
  beforeRouteEnter (to, from, next) {
    next()
  },
  components: {
    ManageTable : () => import('./manageTable'),
    UserTable : () => import('./userTable')
  },
  data() {
    return {
      code:'jdjb-dtjd-szyd'
    };
  },
  computed:{
    permissionBycode(){
      return this.$store.getters['PortalManagement/getPermissionBycode'](this.code)
    },
    role() {
      if (this.permissionBycode.includes(this.code + '_manage')) {
        return 'manage'
      } else if (this.permissionBycode.includes(this.code + '_upload')) {
        return 'upload'
      } else {
        return ''
      }
    }
  },
  mounted() {
  },
  methods: {
  }
};
</script>
<style lang="less" scoped>
.conference_wrap {
  width: 100%;
  padding:20px 20px 10px 20px;
  margin-bottom: 20px;
  background: #fff;
  .tabTitle{
    line-height: 28px;
    font-size: 20px;
    color: #333333;
    font-weight: 600;
    user-select:none;
  }
}
</style>